<?php

declare(strict_types=1);

namespace app\admin\controller\shop;


use think\response\Json;
use app\admin\controller\Controller;

class Order extends Controller
{
    protected $service = null;

    public function initialize()
    {
        parent::initialize();
        $this->service = new \app\admin\service\shop\OrderService();
    }

    /**
     * 列表
     * @return Json
     * @throws \think\db\exception\DbException
     */
    public function list(): Json
    {
        return success($this->service->list());
    }

    public function detail(int $id): Json
    {
        return success($this->service->detail($id, request()->param()));
    }

    public function update(int $id): Json
    {
        return success('更新成功', $this->service->update($id, request()->param()));
    }

    public function refpay(int $id): Json
    {
        return success('操作成功', $this->service->refpay($id, request()->param()));
    }

    public function delete(int $id): Json
    {
        return $this->service->delete($id);
    }

    public function delivery(int $id): Json
    {
        return success('操作成功', $this->service->delivery($id, request()->param()));
    }

    public function refund(int $id): Json
    {
        return $this->service->refund($id, request()->param());
    }

    public function edit_goods(int $id): Json
    {
        return success('操作成功', $this->service->edit_goods($id, request()->param()));
    }

    public function refund_adds(): Json
    {
        return success('保存成功', $this->service->refund_adds(request()->param()));
    }
}
